package com.powazi.model.logging;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Log Model
 * 
 * @author gb
 * @date 2007-12-20
 */
public class LogModel implements Serializable {

	private static final long serialVersionUID = -5354467404028052693L;
	/**
	 * 日志ID
	 */
	private Long id;
	/**
	 * 所在应用的ID
	 */
	private Integer appId;
	/**
	 * 记录日志的时间
	 */
	private Timestamp log_time; // readonly

	/**
	 * 操作类型
	 */
	private Integer operationId;
	/**
	 * 操作对象（袜箱袜子等）
	 */
	private String target;
	/**
	 * 日志内容（固定格式）
	 */
	private String content;
	/**
	 * 日志描述（任意）
	 */
	private String description;
	/**
	 * 来源页面的URL
	 */
	private String srcURL;
	/**
	 * 目标页面的URL
	 */
	private String destURL;

	/**
	 * 执行的Action的名字（可以根据名称得到一些信息）
	 */
	private String actionName;

	/**
	 * 浏览器的sessionid
	 */
	private String sessionId;

	/**
	 * 用户ID
	 */
	private Long userId;

	/**
	 * 当前用户的IP地址
	 */
	private String ipAddress;

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("LogModel : ");
		sb.append("appId " + this.appId);
		sb.append(", operationId " + this.operationId);
		sb.append(", target " + this.target);
		sb.append(", content " + this.content);
		sb.append(", url " + this.srcURL);
		sb.append(", roUrl " + this.destURL);
		sb.append(", userId " + this.userId);
		sb.append(", actionName " + this.actionName);

		return "";

	}

	/*
	 * Getter and Setters.
	 */
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Integer getAppId() {
		return appId;
	}

	public void setAppId(Integer appId) {
		this.appId = appId;
	}

	public Timestamp getLog_time() {
		return log_time;
	}

	public void setLog_time(Timestamp log_time) {
		this.log_time = log_time;
	}

	public Integer getOperationId() {
		return operationId;
	}

	public void setOperationId(Integer operationId) {
		this.operationId = operationId;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getSrcURL() {
		return srcURL;
	}

	public void setSrcURL(String srcURL) {
		this.srcURL = srcURL;
	}

	public String getDestURL() {
		return destURL;
	}

	public void setDestURL(String destURL) {
		this.destURL = destURL;
	}

	public String getActionName() {
		return actionName;
	}

	public void setActionName(String actionName) {
		this.actionName = actionName;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

}
